// pages/mine/store_admin/order_fahuo.js
Page({

  
  data: {   arr:[],index:0,arr2:[],code:'',express_code:''

  },

  
  onLoad: function (options) {
    this.setData({code:options.code})
         this.getkuaidi()
         
  },
    getkuaidi(){
      wx.request({
        url: 'https://zujieba.com/Api/shareradminorder/wuliu.html',
        success:(res)=>{
          console.log(res);
          let arr=res.data.data
          console.log(arr);
          let arr1=[]
          let arr2=[]
          arr.forEach((item)=>{

               arr1.push(item.title)
               arr2.push(item.id)
          })
          console.log(arr1);
          
          this.setData({
             arr:arr1,
             arr2
             
          })

          
        }
      })
    },
    bindPickerChange(e){
      this.setData({index:e.detail.value})
    },
    //lijifahuo
    getlijifahuo(){
      console.log(this.data.code,this.data.arr2[this.data.index],this.data.express_code);
      
      wx.request({
        url: 'https://zujieba.com/Api/shareradminorder/sent.html',
        data:{code:this.data.code,express_where:this.data.arr2[this.data.index],express_code:this.data.express_code},
        success:(res)=>{
          console.log(res);
          if(res.data.success==1){
            wx.navigateBack({
              complete: (res) => {},
            })
          }
          
        }
      })
    },
    change(e){
      this.setData({
        express_code:e.detail.value
      })
    }
    
})